<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                xmlns:comp="http://java.sun.com/jsf/composite/comp"
                template="./template.xhtml">

    <ui:define name="content">
        
        <h:form>
            
            <p:messages id="messages" showDetail="true" autoUpdate="true"/>  
            
            <h:panelGrid id="panelGrid" columns="2">
                <h:outputLabel value="User name" for="name" />
                <p:inputText id="name" value="#{editUserManagedBean.user.name}" title="user name" required="true" label="user name" readonly="true"/>
                <h:outputLabel value="Password 1*" for="password" />
                <p:password id="password" match="password2" value="#{editUserManagedBean.password1}" title="password 1" label="password 1" required="true" feedback="true"/>
                <h:outputLabel value="Password 2*" for="password2" />
                <p:password id="password2" value="#{editUserManagedBean.password2}" title="password" label="password 2" required="true"/>
                <h:outputLabel value="Email *" for="email" />
                <p:inputText id="email" value="#{editUserManagedBean.email}" title="email" required="true" label="email"/>                    
            </h:panelGrid>
            <br />
            <p:commandButton id="saveButton" update="panelGrid" value="Save" action="#{editUserManagedBean.editUser()}" />
            <br />                
        </h:form>
    </ui:define>

</ui:composition>
